package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.ThesisDao;
import com.internship.model.Thesis;
import com.internship.page.Page;

@Service
public class ThesisService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private ThesisDao thesisDao;

	public Page<Thesis> getThesisList(String studentName,String XY,String ZYDM,String XZB,String DQSZJ,int pageNumber) {
		Page<Thesis> page = new Page<Thesis>(pageNumber, PAGE_SIZE);
		List<Thesis> list = thesisDao.getThesisList(studentName, XY, ZYDM, XZB, DQSZJ, page);
		page.setResultList(list);
		return page;
	}
	public Page<Thesis> getThesisByThList(String studentName,String teacherNumber,String XZB,String DQSZJ,int pageNumber) {
		Page<Thesis> page = new Page<Thesis>(pageNumber, PAGE_SIZE);
		List<Thesis> list = thesisDao.getThesisByThList(studentName, teacherNumber, XZB, DQSZJ, page);
		page.setResultList(list);
		return page;
	}	
	public Thesis getThesisByStudentNumber(String studentNumber) {
		return thesisDao.getThesisByStudentNumber(studentNumber);
	}
	public List<Thesis> getMyThesisList(String studentNumber){
		return thesisDao.getMyThesisList(studentNumber);
	}
	public int addThesis(Thesis thesis) {
		return thesisDao.addThesis(thesis);
	}
	public int whetherMarking(Thesis thesis) {
		return thesisDao.whetherMarking(thesis);
	}
	public int updateThesis(Thesis thesis) {
		return thesisDao.updateThesis(thesis);
	}
	public int delThesis(String studentNumber) {
		return thesisDao.delThesis(studentNumber);
	}
}
